class DatabaseRouter(object):
    def db_for_read(self, model, **hints):
        "Point all operations on vpay models to 'slave'"
        if model._meta.app_label == 'bmhdemo':
            return 'slave'
        return None

    def db_for_write(self, model, **hints):
        "Point all operations on vpay models to 'cdd'"
        if model._meta.app_label == 'bmhdemo':
            return 'jnsd'
        return None

    def allow_relation(self, obj1, obj2, **hints):
        if obj1._meta.app_label == 'bmhdemo':
            return True
        return None

    def allow_syncdb(self, db, model):
        if db == 'jnsd':
            return model._meta.app_label == 'bmhdemo'
        elif model._meta.app_label == 'bmhdemo':
            return False
        return None
